package ReviewTest;

import java.util.Scanner;

public class demo01 {
    public static void main(String[] args) {
        //定义长度为5的数组
        int[] arr = new int[5];
        //创建扫描器
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请输入整数");
            arr[i] = sc.nextInt();
        }
        //定义sum
        int sum = 0;
        for (int j = 0; j < arr.length; j++) {
            sum += arr[j];
        }
        System.out.println(sum);
    }
}
